package net.wzw.enums;

import org.assertj.core.util.Maps;

import java.util.HashMap;
import java.util.Map;

/**
 * @author wzw
 * @date 2025/4/19
 * @Description
 */
public enum FoodCateTag {

    /**
     * 私房菜
     */
    PRIVATE_HOME(1, "私房菜"),

    /**
     * 家常菜
     */
    HOME_STYLE(2, "家常菜"),

    /**
     * 硬菜
     */
    HARD_STYLE(3, "硬菜"),

    /**
     * 小吃
     */
    SNACKS_STYLE(4, "小吃"),

    /**
     * 开胃菜
     */
    APPETIZERS_STYLE(5, "开胃菜"),

    /**
     * 甜点
     */
    DESSERTS_STYLE(6, "甜点"),

    /**
     * 减脂餐
     */
    Low_FAT_STYLE(7, "减脂餐"),

    /**
     * 素菜
     */
    VEGETARIAN_STYLE(8, "素菜"),

    /**
     * 养生菜
     */
    HEALTH_STYLE(9, "养生菜");

    private Integer tag;

    private String tagValue;

    private FoodCateTag(Integer tag, String tagValue) {
        this.tag = tag;
        this.tagValue = tagValue;
    }

    public Integer getTag() {
        return tag;
    }

    public String getTagValue() {
        return tagValue;
    }


    public static Map<Integer,String> toMap(){

        // Map<Integer,String> map =   Maps.newHashMap();

        Map<Integer,String> map = new HashMap<>();

        for(FoodCateTag element : FoodCateTag.values()){

            map.put(element.getTag(), element.getTagValue());

        }

        return map;

    }
    /*
     * Description: 根据Tag获取对应的tagValue
     * @param null
     * @Return: {@link null}
     * @Author: Administrator
     * @Date: 2025/4/19 22:39
     */

    public static FoodCateTag getByTag(Integer tag){

        if(tag == null){

            return  null;

        }

        for(FoodCateTag element : FoodCateTag.values()){

            if(tag.equals(element.getTag())){

                return  element;

            }

        }
        return  null;

    }

}
